﻿using System.Text;

namespace Tools
{
    public static class Tools
    {
        public static byte[] ToByteArray(this string s)
        {
            var asciiEncoding = new ASCIIEncoding();
            return asciiEncoding.GetBytes(s);
        }

        public static string ToAsciiString(this byte[] b)
        {
            var asciiEncoding = new ASCIIEncoding();
            return asciiEncoding.GetString(b);
        }
    }
}